package com.iot.spi.config;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Setter
@Getter
@Component
@ConfigurationProperties(prefix = "iot")
public class IotSpiConfig {

    private SpiConfig spi = new SpiConfig();

    private EmqxConfig emqx = new EmqxConfig();

    private Boolean enabled = true;

    @Setter
    @Getter
    @NoArgsConstructor
    @AllArgsConstructor
    public class SpiConfig {
        private String appKey;

        private String appSecret;

        private String host;
    }

    @Setter
    @Getter
    @NoArgsConstructor
    @AllArgsConstructor
    public class EmqxConfig {
        private String userName;

        private String password;

        private String host;

        private String env;
    }

}